package chase.myrewards.beans;

import java.io.Serializable;
import java.sql.Date;
import java.util.ArrayList;

/**
 * Bean class that holds data for rewards points usage
 * 
 * @author Meena Abdou
 * @date April 24, 2013
 */
public class RewardsUsageBean implements Serializable {
	
	/**
	 * This number must be unique for every class. And it can never change.
	 * You have to generate it automatically by clicking on the class name and
	 * then hitting Ctrl+1.  Then click on Add generated serial version ID. Then
	 * copy these comments on top of the generated id.
	 * 
	 * @serial serialVersionUID
	 */
	private static final long serialVersionUID = -8231083951218403272L;
	
	private ArrayList<Integer> usedPoints;
	private ArrayList<Date> date;
	private ArrayList<String> description;
	private int size;
	
	public RewardsUsageBean(){
		usedPoints = new ArrayList<Integer>();
		date = new ArrayList<Date>();
		description = new ArrayList<String>();
		size = 0;
	}
	
	/**
	 * Use these insert functions to populate the lists instead of setters
	 */
	
	public void insertEntry(int points, Date d, String description){
		this.usedPoints.add(points);
		this.date.add(d);
		this.description.add(description);
		setSize(usedPoints.size());
	}
	
	public void insertUsedPoints(int points){
		this.usedPoints.add(points);
	}
	
	public void insertDate(Date d){
		this.date.add(d);
	}
	
	public void insertDescription(String description){
		this.description.add(description);
	}

	public ArrayList<Integer> getUsedPoints() {
		return usedPoints;
	}

	public ArrayList<Date> getDate() {
		return date;
	}

	public ArrayList<String> getDescription() {
		return description;
	}

	public void setUsedPoints(ArrayList<Integer> usedPoints) {
		this.usedPoints = usedPoints;
	}

	public void setDate(ArrayList<Date> date) {
		this.date = date;
	}

	public void setDescription(ArrayList<String> description) {
		this.description = description;
	}

	public void setSize(int size) {
		this.size = size;
	}

	public int getSize() {
		return size;
	}	
}
